home *** CD-ROM | disk | FTP | other *** search
/ Champak 123 / (Vol 123) Jan 13 2011.iso / Games / action_fishing.swf / scripts / frame_19 / PlaceObject2_157_12 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2011-01-13  |  2KB  |  90 lines

  1. onClipEvent(enterFrame){
  2.    function reiniciar()
  3.    {
  4.       aspecto = random(20) + 1;
  5.       direccion = random(2) + 1;
  6.       if(direccion == 1)
  7.       {
  8.          this.gotoAndPlay(aspecto);
  9.          this._x = random(200) + 610;
  10.          sentido = 1;
  11.       }
  12.       if(direccion == 2)
  13.       {
  14.          this.gotoAndPlay(aspecto + 20);
  15.          this._x = - random(200);
  16.          sentido = -1;
  17.       }
  18.       this._rotation = 0;
  19.       pescado = false;
  20.       this._y = random(130) + 210;
  21.    }
  22.    if(_root.pausa == false)
  23.    {
  24.       if(_root.tiempo <= 0)
  25.       {
  26.          this.unloadMovie();
  27.       }
  28.       if(this.hitTest(_root.tipo.raya.anzuelo) && _root.tipo.raya._currentframe > 15)
  29.       {
  30.          pescado = true;
  31.          if(aux == true)
  32.          {
  33.             if(_root.pesco == 0)
  34.             {
  35.                _root.pesco = 1;
  36.             }
  37.             else if(_root.pesco == 1)
  38.             {
  39.                _root.pesco = 2;
  40.             }
  41.          }
  42.          aux = false;
  43.       }
  44.       if(pescado == true)
  45.       {
  46.          this._rotation = 90;
  47.          this._y = _root.tipo.raya.anzuelo._y + 120;
  48.          this._x = _root.tipo._x + _root.tipo._width / 2;
  49.          nn = random(60);
  50.          if(nn == 2 && this._y > 270)
  51.          {
  52.             _root.pesco = 0;
  53.             this._rotation = 0;
  54.             pescado = false;
  55.          }
  56.          if(_root.tipo.raya._currentframe == 1)
  57.          {
  58.             if(_root.pesco >= 2)
  59.             {
  60.                _root.combo.gotoAndPlay(2);
  61.                _root.pesco = 0;
  62.             }
  63.             _root.pesco = 0;
  64.             _root.splash.gotoAndPlay(2);
  65.             _root.splash._x = this._x;
  66.             _root.puntos += 60;
  67.             mysoundobj = new Sound(this);
  68.             mysoundobj.attachSound("pesco");
  69.             mysoundobj.setVolume(50);
  70.             mysoundobj.start();
  71.             reiniciar();
  72.             pescado = false;
  73.             aux = true;
  74.          }
  75.       }
  76.       else
  77.       {
  78.          if(this._x < -100 and direccion == 1)
  79.          {
  80.             reiniciar();
  81.          }
  82.          if(this._x > 800 and direccion == 2)
  83.          {
  84.             reiniciar();
  85.          }
  86.          this._x -= velocidad * sentido;
  87.       }
  88.    }
  89. }
  90.